package mazeMultiThread;

//My MouseListener 

import java.awt.event.*;

/**
 * Controls global variables to synchronize properties between threads
 * @author Dani
 *
 */
public class VentanaMouseListener implements MouseListener, MouseWheelListener
{
	@Override
	/**
	 * Zooms in or out depending on which way the mouse wheel was turned
	 */
	public void mouseWheelMoved(MouseWheelEvent arg0) {
		if (arg0.getPreciseWheelRotation() > 0) 
			GH.scaleDown();
		else 
			GH.scaleUp();
		//System.out.println(arg0.getX() + " " + arg0.getY());
	}
	
	/**
	 * Controls various mouse events whenever a mouse button is clicked
	 */
	public void mouseClicked(MouseEvent e)
	{
		//if control was down, restart the maze
		if (e.isControlDown()) 
			GH.RESTART = true;

		//if shift was down, toggle the debug view mode of the generation process
		if (e.isShiftDown()) 
			GH.PRINT_STATUS = !GH.PRINT_STATUS;
			
		//if no special keys were pressed, toggle pause mode
		if (!e.isShiftDown() && !e.isControlDown())
			GH.PAUSE = !GH.PAUSE;
	}
	
	//Unused inherited methods below
	
	public void mouseEntered(MouseEvent e) { }
	public void mouseExited(MouseEvent e) { }
	public void mousePressed(MouseEvent e) { }
	public void mouseReleased(MouseEvent e) { }



}



